package book;

public class BookList {
    Book[] books = new Book[10];

    private int usedSize;//计数器，计算当前已经存放了的书的数量

    public BookList() {
        //构造方法 初始化成员变量 最开始有三本书
        this.books[0] = new Book("水浒传","施耐庵",19,"小说");
        this.books[1] = new Book("三国演义","罗贯中",15,"小说");
        this.books[2] = new Book("红楼梦","曹雪芹",14,"小说");

        this.usedSize = 3;//最开始就书架上有三本书
    }

    public Book getBooks(int pos) {
        return books[pos];
    }

    public void setBooks(int pos, Book book) {
        books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
